/*
 *	This file is part of Lounge-Cast.
 *
 *  Author:  	Markus Moormann
 *	E-mail:  	mmoorman@uni-osnabrueck.de
 *	Copyright:	University of Osnabrueck (Zentrum Virtuos)
 * 	Website:	www.uni-osnabrueck.de
 *	Date:		16.02.2011
 *
 *	Lounge-Cast is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *	Lounge-Cast is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Lounge-Cast.  If not, see <http://www.gnu.org/licenses/>.
 */
package multimedia.control
{
	import com.adobe.cairngorm.control.FrontController;
	
	import multimedia.control.command.*;
	import multimedia.control.command.webservice.*;
	import multimedia.control.event.*;
	import multimedia.control.event.webservice.*;
	
	/**
	 * 	Controller
	 * 
	 *	@author jemden
	 *	@version 1.0
	 */
	public class Controller extends FrontController
	{
		//----------------------------------------------------------------------------------------------
		//
		//  Constructor
		//
		//----------------------------------------------------------------------------------------------
		
		public function Controller()
		{
			super();
			addCommand(ChangeStateEvent.CHANGE, ChangeStateCommand);
			addCommand(GetPreferencesEvent.GET, GetPreferencesCommand);
			addCommand(InitializeApplicationEvent.INITIALIZE, InitializeApplicationCommand);
			addCommand(ImportPreferencesEvent.IMPORT, ImportPreferencesCommand);
			addCommand(LoadDFXPXMLEvent.LOAD, LoadDFXPXMLCommand);
			addCommand(LoadImageEvent.LOAD, LoadImageCommand);
			addCommand(LoadVideoEvent.LOAD, LoadVideoCommand);
			addCommand(LoadViewerXMLEvent.LOAD, LoadViewerXMLCommand);
			addCommand(LoadSlideEvent.LOAD, LoadSlideCommand);
			addCommand(LoadTextEvent.LOAD, LoadTextCommand);
			addCommand(SetNextMediaElementEvent.SET, SetNextMediaElementCommand);
			addCommand(SetSerialElementEvent.SET, SetSerialElementCommand);
			addCommand(UpdatePreferencesEvent.UPDATE, UpdatePreferencesCommand);
			addCommand(UpdateRssFeedPlayStatusEvent.UPDATE, UpdateRssFeedPlayStatusCommand);
			
			addWebserviceCommands();
		}
		
		private function addWebserviceCommands():void
		{
			addCommand(ValidateEvent.VALIDATE, ValidateCommand);
			addCommand(GetNewsRSSEvent.GET, GetNewsRSSCommand);
			addCommand(NextEvent.NEXT, NextCommand);
			addCommand(UpdateFeedsEvent.UPDATE, UpdateFeedsCommand);
			addCommand(UpdateIPEvent.UPDATE, UpdateIPCommand);
		}
	}
}

